package com.zhoug.player.vlcplayer;

/**
 * VLC MediaPlayer的状态定义
 *
 * @author: zhoug
 * @since: 2025-08-14
 */
public class VLCPlayerState {
    //初始或空闲状态（无操作发生）
    public static final int IDLE = 0;
    //媒体正在打开/加载中（如网络连接建立或本地文件解析
    public static final int START = 1;
    //媒体正在播放中
    public static final int PLAYING = 3;
    //媒体已暂停
    public static final int PAUSED = 4;
    //媒体已停止（用户主动触发）
    public static final int STOPPED = 5;
    //播放自然结束（媒体播放到结尾）
    public static final int ENDED = 6;
    //播放过程中发生错误（如文件损坏、网络中断）
    public static final int ERROR = 7;


    public static String getStateName(int state) {
        return switch (state) {
            case IDLE -> "IDLE";
            case START -> "START";
            case PLAYING -> "PLAYING";
            case PAUSED -> "PAUSED";
            case STOPPED -> "STOPPED";
            case ENDED -> "ENDED";
            case ERROR -> "ERROR";
            default -> "null";
        };
    }


}
